<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta charset="utf-8" />
		<title></title>
		<meta name="description" content="overview & stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="static/css/bootstrap.min.css" rel="stylesheet" />
		<link href="static/css/bootstrap-responsive.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="static/css/font-awesome.min.css" />
		<!-- 下拉框 -->
		<link rel="stylesheet" href="static/css/chosen.css" />
		
		<link rel="stylesheet" href="static/css/ace.min.css" />
		<link rel="stylesheet" href="static/css/ace-responsive.min.css" />
		<link rel="stylesheet" href="static/css/ace-skins.min.css" />
		<link rel="stylesheet" href="static/css/datepicker.css" /><!-- 日期框 -->


	</head>
<body>
	<form action="registeronlinetran/${msg}.do" name="Form" id="Form" method="post">
		<input type="hidden" name="REGISTERONLINETRAN_ID" id="REGISTERONLINETRAN_ID" value="${pd.REGISTERONLINETRAN_ID}"/>
		<div id="zhongxin">
		<table id="table_report" class="table table-striped table-bordered table-hover">
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">公司名称:</td>
				<td><input type="text" name="cmpName" id="cmpName" value="${cmpName}" maxlength="32" placeholder="这里输入公司名称" title="公司名称" disabled="disabled"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">商户名称:</td>
				<td><input type="text" name="riName" id="riName" value="${riName}" maxlength="32" placeholder="这里输入商户名称" title="商户名称" disabled="disabled"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">员工姓名:</td>
				<td style="vertical-align:top;text-align: left!important;">
					<select class="chzn-select" name="EI_CODE" id="EI_CODE" data-placeholder="请选择" style="vertical-align:top;width: 120px;">
						<option value=""></option>
						<c:forEach items="${empList}" var="var" >
							<option value="${var.EI_EMINFO}" <c:if test="${var.EI_EMINFO == pd.EI_CODE}">selected</c:if>>${var.EI_NAME}</option>
						</c:forEach>
					</select>
				</td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">交易金额:</td>
				<td><input type="text" name="RL_AMOUNT" id="RL_AMOUNT" value="${pd.RL_AMOUNT}" maxlength="32" placeholder="这里输入交易金额" title="交易金额"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">交易日期:</td>
				<td><input type="text" name="TD_TIME" id="TD_TIME" value="${pd.TD_TIME}" maxlength="32" placeholder="这里输入交易日期" title="交易日期"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">登记时间:</td>
				<td><input type="text" name="RL_TIME" id="RL_TIME" value="${pd.RL_TIME}" maxlength="32" placeholder="这里输入登记时间" title="登记时间"/></td>
			</tr>
			<tr>
				<td style="width:70px;text-align: right;padding-top: 13px;">备注:</td>
				<td><input type="text" name="REMARKS" id="REMARKS" value="${pd.REMARKS}" maxlength="32" placeholder="这里输入备注信息" title="备注信息""/></td>
			</tr>
			<tr>
				<td style="text-align: center;" colspan="10">
					<a class="btn btn-mini btn-primary" onclick="save()">保存</a>
					<a class="btn btn-mini btn-danger" onclick="top.Dialog.close();">取消</a>
				</td>
			</tr>
		</table>
		</div>
		
		<div id="zhongxin2" class="center" style="display:none"><br/><br/><br/><br/><br/><img src="static/images/jiazai.gif" /><br/><h4 class="lighter block green">提交中...</h4></div>
		
	</form>
	
	
		<!-- 引入 -->
		<script type="text/javascript">window.jQuery || document.write("<script src='static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
		<script src="static/js/bootstrap.min.js"></script>
		<script src="static/js/ace-elements.min.js"></script>
		<script src="static/js/ace.min.js"></script>
		<script type="text/javascript" src="static/js/chosen.jquery.min.js"></script><!-- 下拉框 -->
	<script type="text/javascript" src="static/js/bootbox.min.js"></script><!-- 确认窗口 -->
	<%--	<script type="text/javascript" src="static/js/bootstrap-datepicker.min.js"></script><!-- 日期框 -->--%>
	<script type="text/javascript" src="static/js/laydate.js"></script>
	<script type="text/javascript" src="static/js/jquery.tips.js"></script><!--提示框-->
		<script type="text/javascript">
		$(top.hangge());
		$(function() {
			
			//单选框
			$(".chzn-select").chosen(); 
			$(".chzn-select-deselect").chosen({allow_single_deselect:true});

            laydate.render({
                elem: '#TD_TIME' ,//指定元素
                type:'datetime'
            });
            laydate.render({
                elem: '#RL_TIME' ,//指定元素
                type:'datetime'
            });
			
		});
		</script>
	<script type="text/javascript">

        var pdObj = '${pdObj}';
        var obj = null;
        if(pdObj == null || pdObj == ''){
            obj = new Object();
        }
        else{
            obj = $.parseJSON('${pdObj}');
        }
        //保存
        function save(){
            if($("#EI_CODE").val()==""){
                $("#EI_CODE").tips({
                    side:3,
                    msg:'请输入公司名称',
                    bg:'#AE81FF',
                    time:2
                });
                $("#AL_CODE").focus();
                return false;
            }
            if($("#riName").val()==""){
                $("#riName").tips({
                    side:3,
                    msg:'请输入商户名称',
                    bg:'#AE81FF',
                    time:2
                });
                $("#riName").focus();
                return false;
            }
            if($("#RL_AMOUNT").val()==""){
                $("#RL_AMOUNT").tips({
                    side:3,
                    msg:'请输入交易金额',
                    bg:'#AE81FF',
                    time:2
                });
                $("#RL_AMOUNT").focus();
                return false;
            }
            if($("#TD_TIME").val()==""){
                $("#TD_TIME").tips({
                    side:3,
                    msg:'请输入交易日期',
                    bg:'#AE81FF',
                    time:2
                });
                $("#TD_TIME").focus();
                return false;
            }
            if($("#RL_TIME").val()==""){
                $("#RL_TIME").tips({
                    side:3,
                    msg:'请输入登记时间',
                    bg:'#AE81FF',
                    time:2
                });
                $("#RL_TIME").focus();
                return false;
            }
            var EI_CODE = $("#EI_CODE").val();
            var RL_AMOUNT = $("#RL_AMOUNT").val();
            var TD_TIME = $("#TD_TIME").val();
            var RL_TIME = $("#RL_TIME").val();
            var REMARKS = $("#REMARKS").val();
            if(EI_CODE == obj.EI_CODE && RL_AMOUNT == obj.RL_AMOUNT && TD_TIME == obj.TD_TIME && RL_TIME == obj.RL_TIME && REMARKS == obj.REMARKS){
               // alert("您没更新任何信息，无法提交更新!");
                bootbox.confirm("您没更新任何信息，无法提交更新!", function(result) {
                    if(result) {
                        top.jzts();
                    }
                });l
				return false;
            }
            if(obj.RL_STATE != null && obj.RL_STATE != 1){
                //alert("改笔补录信息已属于完成确认状态，无法进行修改");
                bootbox.confirm("改笔补录信息已属于完成确认状态，无法进行修改!", function(result) {
                    if(result) {
                        top.jzts();
                    }
                });
                return false;
            }
            $("#Form").submit();
            $("#zhongxin").hide();
            $("#zhongxin2").show();
        }

	</script>
</body>
</html>